import React,{memo} from 'react'
import { Avatar } from 'antd'

function UserCheckboxList(props, ref){
  console.log( props.props.checked)
  const itemsFu = (obj)=>{
      obj.checked = !obj.checked;
    let item = new Date().getTime();
      obj.key =obj.uid + item
    props.onCheckbox(obj);

  }

  return <>
       <div  className="check-item check-item2">
         <div className="check-l">
           <div className="check-img">
             <Avatar size={30} src={ props.props.avatar} />
           </div>
           <div className="check-text">
             {props.props.label}
           </div>
         </div>

         <div  onClick={()=>itemsFu(props.props)} className="check-text">
           <i className="iconfont mt-roundclosefill"></i>
         </div>
       </div>
  </>
}

export default  memo(UserCheckboxList);
